package com.yj.cmp.sdk.fusioncompute.compute.vm.dto;

import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Map;

@NoArgsConstructor
@Data
public class ChangeVmDto {

    @SerializedName("name")
    private String name;
    @SerializedName("description")
    private String description;
    @SerializedName("group")
    private String group;
    @SerializedName("location")
    private String location;
    @SerializedName("externalUuid")
    private String externalUuid;
    @SerializedName("isTemplate")
    private boolean isTemplate;
    @SerializedName("cpu")
    private CpuDTO cpu;
    @SerializedName("memory")
    private MemoryDTO memory;
    @SerializedName("graphicsCard")
    private GraphicsCardDTO graphicsCard;
    @SerializedName("properties")
    private Map<String, Object> properties;
    @SerializedName("osOptions")
    private OsOptionsDTO osOptions;
    @SerializedName("vncAccessInfo")
    private VncAccessInfoDTO vncAccessInfo;
    @SerializedName("publickey")
    private String publickey;
    @SerializedName("isMultiDiskSpeedup")
    private boolean isMultiDiskSpeedup;
    @SerializedName("disks")
    private List<DisksDTO> disk;
    @SerializedName("nic")
    private List<NicDTO> nic;
    @SerializedName("resourceGroup")
    private String resourceGroup;

    @NoArgsConstructor
    @Data
    public static class MemoryDTO {
        @SerializedName("hugePage")
        private String hugePage;
        @SerializedName("limit")
        private Integer limit;
        @SerializedName("memHotPlug")
        private Integer memHotPlug;
        @SerializedName("quantityMB")
        private Integer quantityMB;
        @SerializedName("reservation")
        private Integer reservation;
        @SerializedName("weight")
        private Integer weight;
        @SerializedName("unit")
        private String unit;
    }

    @NoArgsConstructor
    @Data
    public static class GraphicsCardDTO {
        @SerializedName("size")
        private Integer size;
        @SerializedName("type")
        private String type;
    }

    @NoArgsConstructor
    @Data
    public static class CpuDTO {
        @SerializedName("coresPerSocket")
        private Integer coresPerSocket;
        @SerializedName("cpuBindType")
        private String cpuBindType;
        @SerializedName("cpuHotPlug")
        private Integer cpuHotPlug;
        @SerializedName("cpuPolicy")
        private String cpuPolicy;
        @SerializedName("cpuThreadPolicy")
        private String cpuThreadPolicy;
        @SerializedName("limit")
        private Integer limit;
        @SerializedName("numaBinds")
        private List<VmDto.VmConfigDTO.CpuDTO.CpuNumaBind> numaBinds;
        @SerializedName("quantity")
        private Integer quantity;
        @SerializedName("reservation")
        private Integer reservation;
        @SerializedName("weight")
        private Integer weight;
        @SerializedName("exactCpuAffinityList")
        private List<VmDto.VmConfigDTO.CpuDTO.ExactCpuAffinity> exactCpuAffinityList;
        @SerializedName("affinitySet")
        private Integer[] affinitySet;

        @NoArgsConstructor
        @Data
        public static class ExactCpuAffinity {
            @SerializedName("vcpuScope")
            private Integer vcpuScope;
            @SerializedName("pcpuScope")
            private String pcpuScope;
        }

        @NoArgsConstructor
        @Data
        public static class CpuNumaBind {
            @SerializedName("nodeId")
            private Integer nodeId;
            @SerializedName("vcpus")
            private String vcpus;
        }
    }

    @NoArgsConstructor
    @Data
    public static class OsOptionsDTO {
        @SerializedName("osType")
        private String osType;
        @SerializedName("osVersion")
        private Integer osVersion;
    }

    @NoArgsConstructor
    @Data
    public static class VncAccessInfoDTO {
        @SerializedName("hostIp")
        private String hostIp;
        @SerializedName("vncPort")
        private Integer vncPort;
        @SerializedName("vncPassword")
        private String vncPassword;
        @SerializedName("vncOldPassword")
        private String vncOldPassword;
    }

    @NoArgsConstructor

    @Data
    public static class DisksDTO {
        @SerializedName("volumeUrn")
        private String volumeUrn;
        @SerializedName("bootOrder")
        private Integer bootOrder;
    }

    @Data
    public static class NicDTO {
        @SerializedName("volumeUrn")
        private String volumeUrn;
        @SerializedName("bootOrder")
        private Integer bootOrder;
    }

}
